﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace UsersLib
{
    public class OcrChar
    {

        public char Translater(string charline)
        {
            if (string.IsNullOrEmpty(charline)) return 'x';
            
            if (charline.Length!=9) return 'x';    

            switch (charline)
            {
                case "010101111":
                    return '0';
                case "000001001":
                    return '1';
                case "010011110":
                    return '2';
                case "010011011":
                    return '3';
                case "000111001":
                    return '4';
                case "010110011":
                    return '5';
                case "010110111":
                    return '6';
                case "010001001":
                    return '7';
                case "010111111":
                    return '8';
                case "010111001":
                    return '9';
                default:
                    return 'x';
            }

        }
        
    }
}
